<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%request.setCharacterEncoding("utf-8"); %>

<%@ page import="java.util.List" %>
<%@ page import="bean.Book" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Insert title here</title>
</head>
<body>
<h2>
    <a href="add.jsp">添加图书</a>
</h2>
<table border="5">
    <tr>
        <th>书名</th>
        <th>作者</th>
        <th></th>
        <th></th>
    </tr>

<%
    List<Book> bookList = (List<Book>)request.getAttribute("rsList");
    for(Book book: bookList) {
%>
<tr>
    <td><%=book.getBookName()%></td>
    <td><%=book.getAuthor()%></td>
    <td> <a href="FindBookServlet?id=<%=book.getId()%>" >查询</a> </td>
    <td> <a href="DeleteBookServlet?id=<%=book.getId()%>">删除</a> </td>
</tr>
<%
    }
%>
</table>
${deleteMsg}
</body>
</html>